<template>
  <div id="app">
    <div class="main">

      <!-- 路由视图 -->
      <router-view @get-mv-id="getMVid" @get-player-id="getPlayerId" @get-play-all-id="getPlayAllId" @get-ssongslistFun="getSsongslistFun" :Ssonglist='Ssonglist'></router-view>
      <!-- 播放器组件 -->
      <player v-show="playerId" :player-id="playerId" :list-id="listId" @set-player-id="setPlayerId"></player>
    </div>
  </div>
</template>

<script>
import player from "./components/base/player.vue"
// import mvplay from "./components/MV/MV.vue"
export default {
  data(){
    return {
      playerId:null,
      listId:null,
      mvplayId:null,
      Ssonglist:[],// 歌单歌曲列表
    }
  },
  methods:{
    // 暂停音乐
    // getLoadeddataFun(){

    // },
    // 获取子组件播放歌曲id
    getPlayerId(id){
      console.log("歌曲id",id);
      this.playerId = id;
    },
    // 获取该列表的所有ID
    getPlayAllId(id){
      this.listId = id;
    },
    // 
    setPlayerId(id){
      this.playerId = id;
      // console.log(id)
    },
    // 获取MV的ID
    getMVid(id){
      console.log(id)
      this.mvplayId = id;
    },
    getSsongslistFun(lists){
      this.Ssonglist = lists;
      console.log(this.Ssonglist)
    },
  },
  components:{
    player,
  },
}
</script>

<style lang="less">
@import "./assets/css/base.css";



</style>